<!--
 * @Description: 用户操作日志 - 主页面
 * @Author:
 * @Date: 2022-03-11 23:12:12
 * @LastEditors: DHL
 * @LastEditTime: 2022-11-22 17:53:17
-->
<template>
  <tw-layout @refresh="handleRefresh" @search="handleSearch" @reset="handleReset">
    <!-- 按钮组 -->
    <template #btns>
      <el-button
        class="item"
        type="danger"
        :loading="loadingByDel"
        :disabled="isSelectRows"
        @click="handleDelete()"
      >
        <svg-icon iconClass="delete"></svg-icon>
        批量删除
      </el-button>
    </template>

    <!-- 查询表单 -->
    <template #header>
      <el-form ref="searchFormRef" :model="searchForm" label-width="90px">
        <el-row>
          <el-col :span="6">
            <el-form-item label="用户名">
              <el-input
                v-model="searchForm.userLoginName"
                clearable
                placeholder="请输用户名"
              ></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="姓名">
              <el-input v-model="searchForm.userName" clearable placeholder="请输姓名"></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="业务编号">
              <el-input
                v-model="searchForm.resourceNo"
                clearable
                placeholder="请输业务编号"
              ></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="用户访问地址">
              <el-input
                v-model="searchForm.url"
                clearable
                placeholder="请输用户访问地址"
              ></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="提交参数">
              <el-input v-model="searchForm.param" clearable placeholder="请输提交参数"></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="操作内容">
              <el-input
                v-model="searchForm.logContent"
                clearable
                placeholder="请输操作内容"
              ></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="操作结果">
              <el-select v-model="searchForm.logResult" clearable placeholder="请选择操作结果">
                <tw-dic dicKey="LOGRESULT"></tw-dic>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="主机IP">
              <el-input v-model="searchForm.ip" clearable placeholder="请输主机IP"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </template>

    <!-- 数据表格 -->
    <tw-table
      ref="tableRef"
      :loading="loading"
      :options="tableOptions"
      :events="tableEvents"
      :data="tableData"
      @search="searchList"
    >
      <template #action="{ row }">
        <el-button link type="primary" @click="handleOpenForm('view', row)">查看</el-button>
        <el-button link type="danger" @click="handleDelete(row)">删除</el-button>
      </template>
    </tw-table>

    <logOperationForm ref="formRef" @refreshTableData="handleRefresh"></logOperationForm>
  </tw-layout>
</template>

<script src="./useIndex.ts"></script>

<style scoped lang="scss"></style>
